﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Modeling.CApSetEndModelingApp
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using COMMANDPARAMSLib;
using EngineeringInternalExtension;
using Tecnomatix.Engineering.Ui.WPF;


namespace DnProcessSimulateCommands.Modeling;

public static class CApSetEndModelingApp
{
  private const string REGISTRY_KEY = "DoNotShowAgain";

  public static bool ExeuteSimulationCheck()
  {
    ICoEndSetModelingSimulationParams simulationParams = (ICoEndSetModelingSimulationParams) new CoEndSetModelingSimulationParamsClass();
    simulationParams.ShouldContinue = 1;
    new TxCommandManager().ExecuteCommandByProgIdWithCmdParams("DnProcessSimulateCommands.Modeling.CApSetEndModelingSimulationCmd", (object) simulationParams);
    return simulationParams.ShouldContinue == 1;
  }

  internal static void SaveValueToRegistry(TxWindow wnd, string value)
  {
    TxWindowSettings.StoreWindowValue(wnd, "DoNotShowAgain", (object) value);
  }

  internal static string ReadValueFromRegistry(TxWindow wnd)
  {
    object obj = (object) null;
    TxWindowSettings.RestoreWindowValue(wnd, "DoNotShowAgain", ref obj);
    return obj as string;
  }

  internal static void RemoveValueFromRegistry(TxWindow wnd)
  {
    TxWindowSettings.RemoveWindowValue(wnd, string.Empty, "DoNotShowAgain");
  }

  public static bool ShouldContinue { get; set; } = true;
}
